﻿#ifndef _REC_READ_AVI_H_
#define _REC_READ_AVI_H_

#include "rec_read_base.h"
#include "avi_info.h"


class CRecReadAvi:public CRecReadBase
{
public:
	CRecReadAvi(int clientID = 0,int channel = 0);
	~CRecReadAvi();
	virtual	int Open(const char * filename, uint32_t fileIndex,int64_t startTime = 0, int64_t endTime = 0,bool bClearBuf = false);
   	virtual int ReadFIFONormal();
	virtual int ReadFIFO2Forward();
	virtual int ReadFIFOForward() ;
	virtual int ReadFIFOReback() ;
	virtual int ReadFrame(uchar_t* frameBuf, uint32_t bufLen);
	uint32_t AlignToDataPacket(uint32_t srcOffset);

protected:

	//快进,快退中使用
	uint32_t GetReadPacketSize(uint32_t offset,uint32_t frmSize);
	int  AnalyzeKeyFrame(uchar_t * frameBuf, uint32_t bufLen,uint32_t keyFrmSize);

protected:
	uint32_t m_data_pkt_size; //数据包大小

};


#endif //_REC_READ_H_
